home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / reiser4 / object.h < prev    next >
C/C++ Source or Header  |  2006-01-09  |  4KB  |  137 lines

  1. /* Copyright (C) 2001, 2002, 2003, 2004 by Hans Reiser, licensing governed by
  2.    reiser4progs/COPYING.
  3.    
  4.    object.h -- reiser4 common object functions (regular file, directory,
  5.    etc). */
  6.  
  7. #ifndef REISER4_OBJECT_H
  8. #define REISER4_OBJECT_H
  9.  
  10. #include <reiser4/types.h>
  11.  
  12. extern errno_t reiser4_object_init(object_info_t *info);
  13.  
  14. extern object_entity_t *reiser4_object_recognize(object_info_t *info);
  15.  
  16. extern reiser4_object_t *reiser4_object_form(reiser4_tree_t *tree,
  17.                          reiser4_object_t *parent,
  18.                          reiser4_key_t *object,
  19.                          reiser4_place_t *place,
  20.                          object_init_t init_func);
  21.  
  22. extern reiser4_object_t *reiser4_object_obtain(reiser4_tree_t *tree,
  23.                            reiser4_object_t *parent,
  24.                            reiser4_key_t *key);
  25.  
  26. extern reiser4_object_t *reiser4_object_open(reiser4_tree_t *tree,
  27.                          reiser4_object_t *parent,
  28.                          reiser4_place_t *place);
  29.  
  30. uint64_t reiser4_object_size(reiser4_object_t *object);
  31.  
  32. extern void reiser4_object_close(reiser4_object_t *object);
  33.  
  34. #ifndef ENABLE_MINIMAL
  35. extern errno_t reiser4_object_add_entry(reiser4_object_t *object,
  36.                     entry_hint_t *entry);
  37.  
  38. extern errno_t reiser4_object_rem_entry(reiser4_object_t *object,
  39.                     entry_hint_t *entry);
  40.  
  41. extern errno_t reiser4_object_truncate(reiser4_object_t *object,
  42.                        uint64_t n);
  43.  
  44. extern int64_t reiser4_object_write(reiser4_object_t *object,
  45.                     void *buff, uint64_t n);
  46.  
  47. extern errno_t reiser4_object_refresh(reiser4_object_t *object);
  48.  
  49. extern errno_t reiser4_object_update(reiser4_object_t *object,
  50.                      stat_hint_t *hint);
  51.  
  52. extern reiser4_object_t *reiser4_object_create(entry_hint_t *entry,
  53.                            object_hint_t *hint);
  54.  
  55. extern errno_t reiser4_object_clobber(reiser4_object_t *object);
  56.  
  57. extern errno_t reiser4_object_link(reiser4_object_t *object,
  58.                    reiser4_object_t *child,
  59.                    entry_hint_t *entry);
  60.  
  61. extern errno_t reiser4_object_unlink(reiser4_object_t *object,
  62.                      char *name);
  63.  
  64. extern errno_t reiser4_object_attach(reiser4_object_t *object, 
  65.                      reiser4_object_t *parent);
  66.  
  67. extern errno_t reiser4_object_detach(reiser4_object_t *object, 
  68.                      reiser4_object_t *parent);
  69.  
  70. extern errno_t reiser4_object_layout(reiser4_object_t *object,
  71.                      region_func_t region_func,
  72.                      void *data);
  73.  
  74. extern errno_t reiser4_object_metadata(reiser4_object_t *object,
  75.                        place_func_t place_func,
  76.                        void *data);
  77.  
  78. extern lookup_t reiser4_object_lookup(reiser4_object_t *object,
  79.                       const char *name,
  80.                       entry_hint_t *entry);
  81.  
  82. extern errno_t reiser4_object_stat(reiser4_object_t *object,
  83.                    stat_hint_t *hint);
  84.  
  85. extern errno_t reiser4_object_reset(reiser4_object_t *object);
  86.  
  87. extern errno_t reiser4_object_seek(reiser4_object_t *object,
  88.                    uint32_t offset);
  89.  
  90. extern errno_t reiser4_object_seekdir(reiser4_object_t *object,
  91.                       reiser4_key_t *offset);
  92.  
  93.  
  94. extern uint32_t reiser4_object_offset(reiser4_object_t *object);
  95.  
  96. extern errno_t reiser4_object_telldir(reiser4_object_t *object,
  97.                       reiser4_key_t *offset);
  98.  
  99. extern int64_t reiser4_object_read(reiser4_object_t *object,
  100.                    void *buff, uint64_t n);
  101.  
  102. extern errno_t reiser4_object_readdir(reiser4_object_t *object,
  103.                       entry_hint_t *entry);
  104.  
  105. extern errno_t reiser4_object_entry_prep(reiser4_tree_t *tree,
  106.                      reiser4_object_t *parent,
  107.                      entry_hint_t *entry,
  108.                      const char *name);
  109.  
  110. extern reiser4_object_t *reiser4_dir_create(reiser4_fs_t *fs,
  111.                         reiser4_object_t *parent,
  112.                         const char *name);
  113.  
  114. extern reiser4_object_t *reiser4_reg_create(reiser4_fs_t *fs,
  115.                         reiser4_object_t *parent,
  116.                         const char *name);
  117.  
  118. extern reiser4_object_t *reiser4_sym_create(reiser4_fs_t *fs,
  119.                         reiser4_object_t *parent,
  120.                         const char *name,
  121.                         const char *target);
  122.  
  123. extern reiser4_object_t *reiser4_spl_create(reiser4_fs_t *fs,
  124.                         reiser4_object_t *parent,
  125.                         const char *name,
  126.                         uint32_t mode,
  127.                         uint64_t rdev);
  128.  
  129. extern errno_t reiser4_object_traverse(reiser4_object_t *object, 
  130.                        object_open_func_t open_func,
  131.                        void *data);
  132. #endif
  133.  
  134. #define object_start(object) (&(object)->ent->start)
  135.  
  136. #endif
  137.